package com.jsf.service.impl;

import com.jsf.dao.StudentDao;
import com.jsf.pojo.Student;
import com.jsf.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;

    @Override
    public Student findStudentById(Integer id) {
        return this.studentDao.findStudentById(id);
    }

    @Override
    public List<Student> findStudentByName(String name) {
        return this.studentDao.findStudentByName(name);
    }

    @Override
    public int insertStudent(Student student) {
        return this.studentDao.insertStudent(student);
    }

    @Override
    public int updateStudent(Student student) {
        return this.studentDao.updateStudent(student);
    }

    @Override
    public int deleteStudent(Integer id) {
        return this.studentDao.deleteStudent(id);
    }

    @Override
    public List<Student> selectStudent() {
        return this.studentDao.selectStudent();
    }
}
